﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace HospitalManagement.GUI
{
    public partial class MainForm1 : Form
    {
        public MainForm1()
        {
            InitializeComponent();
        }

        public SqlConnection con;
        //ket  noi database
        public void connect()
        {
            String cn = "Data Source=BINNG\\SQLEXPRESS;Initial Catalog=QUAN LI THONG TIN BENH NHAN;Persist Security Info=True;User ID=sa;Password=123456";
            try
            {
                con = new SqlConnection(cn);
                con.Open();
                MessageBox.Show("Connect Successful!", "Warning", MessageBoxButtons.OK);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Connect Fail!", "Warning", MessageBoxButtons.OK);
            }
        }
        
        /// <summary>
        /// new code
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void navBaruserlist_LinkPressed(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            gcuserlist.Show();
            grcUserInformation.Hide();
            gccChangepass.Hide();
            gccProvince.Hide();
        }

      
        private void navBarCreateUser_LinkPressed(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            gcuserlist.Hide();
            grcUserInformation.Show();
            gccChangepass.Hide();
            gccProvince.Hide();
        }

        private void navBarChangepass_LinkPressed(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            gcuserlist.Hide();
            grcUserInformation.Hide();
            gccChangepass.Show();
            gccProvince.Hide();
        }

        private void navBarProvince_LinkPressed(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            gcuserlist.Hide();
            grcUserInformation.Hide();
            gccChangepass.Hide();
            gccProvince.Show();
        }

        private void btnAdduser_Click(object sender, EventArgs e)
        {
            gcuserlist.Hide();
            grcUserInformation.Show();
            gccChangepass.Hide();
            gccProvince.Hide();
        }

        private void navBarPatientList_LinkPressed(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            gccPatientList.Show();
            gcregisterhealthcare.Hide();
            gcreportregistrationlist.Hide();
            gcregistrationumber.Hide();
        }

        private void navBarRegisterHealthCare_LinkPressed(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            gccPatientList.Hide();
            gcregisterhealthcare.Show();
            gcreportregistrationlist.Hide();
            gcregistrationumber.Hide();
        }

        private void navBarClinicProvinceCity_LinkPressed(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            //gccPatientList.Hide();
            //gcregisterhealthcare.Hide();
            //gcreportregistrationlist.Hide();
            //gcregistrationumber.Hide();
        }

        private void btnAddProvince_Click(object sender, EventArgs e)
        {
            NewCategoryItemForm1 form1 = new NewCategoryItemForm1();
            form1.Show();
        }

        private void btnAddPatient_Click(object sender, EventArgs e)
        {
            gccPatientList.Show();
            gcregisterhealthcare.Hide();
            gcreportregistrationlist.Hide();
            gcregistrationumber.Hide();
        }

       
        
       
    }
}
